.floating-buttons-container {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 10000;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  margin-top: 36px;
  cursor: move;
  user-select: none;
  transition: all 0.3s ease;
  border-radius: 8px;
  touch-action: none; /* 防止触摸设备上的滚动干扰 */
}

.floating-buttons-container.dragging {
  opacity: 0.8 !important;
  transition: none !important;
  background: rgba(255, 255, 255, 0.2);
  cursor: grabbing;
}

.floating-buttons-container:not(.dragging) {
  transition: opacity 0.3s ease;
}

.floating-buttons-container .floating-button {
  cursor: pointer;
}

/* 添加一个透明的背景区域来扩展悬浮触发范围 */
.floating-buttons-container::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100px; /* 足够宽以覆盖展开后的按钮 */
  background: transparent;
  z-index: -1;
}

.floating-button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 44px;
  overflow: hidden;
  position: relative;
}

.floating-buttons-container:hover .floating-button {
  transform: translateX(-5px);
  background: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  padding-right: 16px;
}

/* 添加按钮悬浮特效 */
.floating-button:hover {
  transform: translateX(-10px) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2) !important;
}

.floating-button:hover .button-icon {
  transform: scale(1.1);
  color: #4CAF50;
}

.floating-buttons-container:hover .button-label {
  opacity: 1;
  width: auto;
  margin-left: 4px;
}

.button-icon {
  font-size: 20px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.button-label {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
  opacity: 0;
  width: 0;
  transition: all 0.3s ease;
}

.mark-anything-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 24px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  border-radius: 8px;
  z-index: 10001;
  animation: slideIn 0.3s ease;
  font-size: 14px;
}

.mark-anything-notification.error {
  background: rgba(220, 53, 69, 0.9);
}

.mark-anything-notification.fade-out {
  animation: fadeOut 0.3s ease forwards;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes fadeOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(20px);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateX(10px);
  }
}

/* 生成总结按钮 */
.generate-summary-button {
  background-color: #4CAF50;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s ease;
}

.generate-summary-button:hover {
  background-color: #45a049;
  transform: translateY(-1px);
}

/* 选择文本后的浮动菜单 */
.selection-menu {
  position: absolute;
  display: flex;
  gap: 8px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.98);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.2s ease;
  pointer-events: none;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.selection-menu.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.selection-menu-button {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #333;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.selection-menu-button:hover {
  background: rgba(0, 0, 0, 0.05);
  color: #4CAF50;
}

.selection-menu-button .icon {
  font-size: 16px;
}

/* Add margin to body to prevent content overlap */
body {
  margin-top: 36px;
}

/* Adjust other fixed elements to account for the top margin */
.floating-buttons-container {
  margin-top: 36px;
}

.left-note-container {
  margin-top: 36px;
}

/* 滚动条待办项淡出动画 */
@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

.toggle-completed-button {
  padding: 6px 14px;
  border: none;
  border-radius: 16px;
  background: #f5f5f5;
  color: #666;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-completed-button::before {
  content: '✓';
  font-size: 12px;
  opacity: 0.7;
}

.toggle-completed-button:hover {
  background: #eee;
  color: #333;
  transform: translateY(-1px);
}

.toggle-completed-button:active {
  transform: translateY(0);
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    transform: translateY(10px);
  }
}

/* 动画效果 */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-10px);
  }
}

.floating-button.tools-button {
  margin-top: auto;  /* Push to bottom */
  background: rgba(255, 255, 255, 0.95);
}

.floating-button.tools-button .button-icon {
  color: #2196F3;
}

.floating-button.tools-button:hover .button-icon {
  color: #1976D2;
}